package zust.javaee.entity;

import javax.persistence.*;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

/**
 * Created by liy on 2016/12/18.
 */
@Entity
@Table(name = "tplayer")
public class Tplayer {

    private Integer id;
    private Short type;
    private String studentId;
    private String password;
    private String pwdSalt;
    private Integer corporationNum;  //加入社团个数
    private String name;
    private Date birth;
    private String introduction;
    private String photo;
    private String originPlace;
    private String email;
    private Short gender;
    private String tel;
    private String major;
    private String clazz;
    private Short grade;
    private String dormitory;  //宿舍地址
    private String idCard;
    private String QQ;
    private String wechat;
    private Short status;

    private Set<Tcorporation> tcorporations = new HashSet<Tcorporation>(0);
    private Set<Tmember> tmembers = new HashSet<Tmember>(0);
    private Set<Texperience> texperiences = new HashSet<Texperience>(0);
    private Set<TsignupCorporation> tsignupCorporations = new HashSet<TsignupCorporation>(0);
    private Set<TrequisitionForm> trequisitionForms = new HashSet<TrequisitionForm>(0);

    public Tplayer() {
    }

    @Id
    @GeneratedValue
    @Column(name = "id", unique = true, nullable = false)
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Column(name = "type")
    public Short getType() {
        return type;
    }

    public void setType(Short type) {
        this.type = type;
    }

    @Column(name = "student_id")
    public String getStudentId() {
        return studentId;
    }

    public void setStudentId(String studentId) {
        this.studentId = studentId;
    }

    @Column(name = "password")
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Column(name = "pwd_salt")
    public String getPwdSalt() {
        return pwdSalt;
    }

    public void setPwdSalt(String pwdSalt) {
        this.pwdSalt = pwdSalt;
    }

    @Column(name = "corporation_num")
    public Integer getCorporationNum() {
        return corporationNum;
    }

    public void setCorporationNum(Integer corporationNum) {
        this.corporationNum = corporationNum;
    }

    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Column(name = "birth")
    public Date getBirth() {
        return birth;
    }

    public void setBirth(Date birth) {
        this.birth = birth;
    }

    @Column(name = "introduction")
    public String getIntroduction() {
        return introduction;
    }

    public void setIntroduction(String introduction) {
        this.introduction = introduction;
    }

    @Column(name = "photo")
    public String getPhoto() {
        return photo;
    }

    public void setPhoto(String photo) {
        this.photo = photo;
    }

    @Column(name = "origin_place")
    public String getOriginPlace() {
        return originPlace;
    }

    public void setOriginPlace(String originPlace) {
        this.originPlace = originPlace;
    }

    @Column(name = "email")
    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Column(name = "gender")
    public Short getGender() {
        return gender;
    }

    public void setGender(Short gender) {
        this.gender = gender;
    }

    @Column(name = "tel")
    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    @Column(name = "major")
    public String getMajor() {
        return major;
    }

    public void setMajor(String major) {
        this.major = major;
    }

    @Column(name = "clazz")
    public String getClazz() {
        return clazz;
    }

    public void setClazz(String clazz) {
        this.clazz = clazz;
    }

    @Column(name = "grade")
    public Short getGrade() {
        return grade;
    }

    public void setGrade(Short grade) {
        this.grade = grade;
    }

    @Column(name = "dormitory")
    public String getDormitory() {
        return dormitory;
    }

    public void setDormitory(String dormitory) {
        this.dormitory = dormitory;
    }

    @Column(name = "id_card")
    public String getIdCard() {
        return idCard;
    }

    public void setIdCard(String idCard) {
        this.idCard = idCard;
    }

    @Column(name = "QQ")
    public String getQQ() {
        return QQ;
    }

    public void setQQ(String QQ) {
        this.QQ = QQ;
    }

    @Column(name = "wechat")
    public String getWechat() {
        return wechat;
    }

    public void setWechat(String wechat) {
        this.wechat = wechat;
    }

    @Column(name = "status")
    public Short getStatus() {
        return status;
    }

    public void setStatus(Short status) {
        this.status = status;
    }


    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tplayer")
    public Set<Tcorporation> getTcorporations() {
        return tcorporations;
    }

    public void setTcorporations(Set<Tcorporation> tcorporations) {
        this.tcorporations = tcorporations;
    }

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tplayer")
    public Set<Tmember> getTmembers() {
        return tmembers;
    }

    public void setTmembers(Set<Tmember> tmembers) {
        this.tmembers = tmembers;
    }

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tplayer")
    public Set<Texperience> getTexperiences() {
        return texperiences;
    }

    public void setTexperiences(Set<Texperience> texperiences) {
        this.texperiences = texperiences;
    }

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tplayer")
    public Set<TsignupCorporation> getTsignupCorporations() {
        return tsignupCorporations;
    }

    public void setTsignupCorporations(Set<TsignupCorporation> tsignupCorporations) {
        this.tsignupCorporations = tsignupCorporations;
    }

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tplayer")
    public Set<TrequisitionForm> getTrequisitionForms() {
        return trequisitionForms;
    }

    public void setTrequisitionForms(Set<TrequisitionForm> trequisitionForms) {
        this.trequisitionForms = trequisitionForms;
    }
}
